﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

using CSJ2K.Util.IO;

namespace CSJ2K.Jp2.Boxes
{
    public class UnsupportedBox : Box
    {
        public byte[] Data;

        public UnsupportedBox(Stream source, long start, uint length, BoxTypes type, ulong extendedLength)
            : base(source, start, length, type, extendedLength)
        {
            if (Length == 0) Data = StreamUtil.ReadToEnd(source);
            else if (Length == 1)
            {
                Data = StreamUtil.ReadBytes(source, (int)ExtendedLength - 16);
            }
            else Data = StreamUtil.ReadBytes(source, (int)Length - 8);
        }
    }
}
